package cn.ekuma.odbo.mobile.ui

import android.app.Application
import androidx.paging.PagedListAdapter
import androidx.recyclerview.widget.RecyclerView
import cn.ekuma.odbo.mobile.helper.PageListAdpaterBrowsEditableHelper
import cn.ekuma.odbo.mobile.helper.PageListBrowsEditableHelper
import cn.ekuma.odbo.mobile.room.BaseDao

abstract class AbstractPagedListAdpateEditorViewModel<T : Any,KEY>(application: Application) :AbstractOdboEditorViewModel<T,KEY>(application){

    abstract fun getPageListAdpate(): PagedListAdapter<T, RecyclerView.ViewHolder>

    abstract fun getBaseDao(): BaseDao<T>

    override fun buildBrowsablehelper(): PageListBrowsEditableHelper<T> {
        return PageListAdpaterBrowsEditableHelper(getPageListAdpate(), baseDao = getBaseDao())
    }
}